using System;
using System.Collections.Generic;

namespace LightPersist.Storage
{
	public interface IStorage : IDisposable
	{
		// Maintenance
		void Connect(string connectionString);

		// Read
		void LoadObject(ObjectState objectState);
		// void LoadProperty(ObjectState objectState, string propertyName);

		// Modify
		void CreateObject(ObjectState objectState);
		void DeleteObject(ObjectState objectState);
		void UpdateObject(ObjectState objectState);

		// Security
		bool RequestAccess(ObjectState objectState, AccessMode accessMode);
		AccessMode GetAccess(ObjectState objectState);

		// Reflecting
		IEnumerable<Guid> GetObjectIDs();
		bool IsExists(ObjectState objectState);
	}

	public enum AccessMode
	{
		Unknown,
		Read,
		Write,
		Lock,
	}
}